import {tableOptBtnConfig} from "../table";
import {commonConfig} from '@/config/common';
import {tableTextColumnMap} from "@/utils";

export default {
  "tableId": "generalFunc",
  "name": "通用方法名",
  "columns": [
    {
      label: '设备类别',
      children: [
        {
          key: 'deviceTypeText',
        },
      ],
    },
    {
      label: '方法类型',
      children: [
        {
          key: 'type',
          mapFunc: (data) => tableTextColumnMap(data, commonConfig.commandType)
        },
      ],
    },
    {
      label: '方法名',
      children: [
        {
          key: 'name',
        },
      ],
    },
    {
      label: '方法别名',
      children: [
        {
          key: 'alias',
        },
      ],
    },
    {
      label: '备注',
      children: [
        {
          key: 'remarks',
        }
      ],
    },
    {
      label: '更新时间',
      width: 100,
      children: [
        {
          updatedDate: true
        }
      ],
    },
    {
      "label": "操作",
      "operation": true,
      "width": 220,
      "children": [
        {
          "button": true,
          type: tableOptBtnConfig.edit.type,
        },
        {
          "button": true,
          type: tableOptBtnConfig.copy.type,
          class: 'hover-success',
        },
        {
          "button": true,
          type: tableOptBtnConfig.delete.type,
          class: 'hover-danger',
        }
      ]
    }
  ],
  "filters": [
    {
      "fieldType": "string",
      key: 'deviceType',
      label: '设备类别',
      "dataApi": API.deviceType.deviceTypeAll,
      "options": []
    },
    {
      "fieldType": "string",
      key: 'type',
      label: '方法类型',
      options: commonConfig.commandType
    },
    {
      "fieldType": "input",
      key: 'name',
      label: '方法名',
    },
    {
      "fieldType": "input",
      key: 'alias',
      label: '方法别名',
    },
    {
      "fieldType": "input",
      key: 'remarks',
      label: '备注',
    },
  ]
}
